// components/avatar/avatar.js
var req = require("../../utils/action.js");
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    avatar:{
      type:String,
      value:''
    }
  },

  ready:function(){
    console.log("this.properties.data.avatar:"+this.properties.avatar)
    if(this.properties.avatar){
      let avatarList = this.properties.avatar.split(",")
      for(let i=0;i<avatarList.length;i++){
        if(!avatarList[i].startsWith("http")){
          avatarList[i] = req.actions.fileRoot + avatarList[i]
        }
      }
      this.setData({
        avatarList:avatarList
      })
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {

  }
})
